import 'package:flutter/cupertino.dart';
import 'package:flutter_deer/index/models/user_betting_entity.dart';
import 'package:flutter_deer/widgets/state_layout.dart';

class IndentSearchListProvider extends ChangeNotifier {

  /// Tab的下标
  int _index = 0;
  int get index => _index;
  List<UserBettingEntity>? _waitList = [];
  List<UserBettingEntity>? _winList = [];
  List<UserBettingEntity>? _lossList = [];
  StateType? _stateType = StateType.loading;

  List<UserBettingEntity>? get waitList => _waitList;
  List<UserBettingEntity>? get winList => _winList;
  List<UserBettingEntity>? get lossList => _lossList;
  StateType? get stateType => _stateType;

  void setSearchResult(UserBettingSearchEntity? result){
    this._waitList = result?.waitList;
    this._winList = result?.winList;
    this._lossList = result?.lossList;
    this._stateType = StateType.order;
    notifyListeners();
  }

  void setLoading(){
    this._stateType = StateType.loading;
    notifyListeners();
  }

  void setIndex(int index) {
    _index = index;
    notifyListeners();
  }
}